<?php
if( !defined('SYSTEM_PATH') ) exit('direct script access disallowed');
function JFAutoLoad( $classname ) {
	$classname = str_replace('_','/', $classname);
	$path = "/classes/$classname.class.php";
	if( file_exists( APP_PATH . $path ) ) require( APP_PATH . $path );
	elseif( file_exists( SYSTEM_PATH . $path ) ) require( SYSTEM_PATH . $path );
	else throw new Exception('Could not find class');
}

spl_autoload_register('JFAutoLoad');
